#include <iostream>
using namespace std;

class phone
{
    string brand;
    string model;

public:
    phone(string n_brand, string n_model);
    phone();
    void showphone();
    void setphone(string n_brand, string n_model);
    ~phone();
};
// 自定义构造函数
phone::phone(string n_brand, string n_model) : brand(n_brand), model(n_model)
{
    cout << "gou zao le yi ge phone" << endl;
}
// phone::phone() : brand(""), model("") //默认构造函数
// {
//     cout << "gou zao le yi ge mo ren phone" << endl;
// }

phone::phone() : phone("xiaomi", "mi8") //委托构造函数
{
    cout << "wei tuo gou zao le yi ge mo ren phone" << endl;
}

void phone::showphone()
{
    cout << brand << " " << model << endl;
}
void phone::setphone(string n_brand, string n_model)
{
    brand = n_brand;
    model = n_model;
}

phone::~phone()
{
    cout << "xi gou le yi ge phone" << endl;
}

int main()
{
    phone rq("huawei", "mate40");
    rq.showphone();
    phone tgh;
    tgh.showphone();
    // phone("xiaomi", "mi9");
    return 0;
}
